/**
 * 因为互相可达，所以直接排序即可。
 * 
 */
#include <bits/stdc++.h>
using namespace std;
#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vll = vector<llt>;

int N, M, Q;
vi A;

void work(){ 
    cin >> N >> M >> Q;
    A.assign(N + 1, {});
    for(int i=1;i<=N;++i) cin >> A[i];

    for(int a,b,i=0;i<M;++i){
        cin >> a >> b;
    }

    sort(A.begin(), A.end());

    for(int k,q=1;q<=Q;++q){
        cin >> k;
        cout << A[k] << "\n";
    }
	return;
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);	
    int nofkase = 1;
	// cin >> nofkase;
	while(nofkase--) work();
	return 0;
}